package com.lbn.jfqsc.app.account.order.adapter;

import android.content.Context;

import com.lbn.baseframe.base.BaseRecyclerAdapter;
import com.lbn.baseframe.base.RecyclerViewHolder;
import com.lbn.baseframe.utils.DateUtils;
import com.lbn.jfqsc.R;
import com.lbn.jfqsc.business.bean.SupportList;

import java.util.List;

/**
 * Created by 李炳南
 * 2017/3/1.
 */

public class SupportAdapter extends BaseRecyclerAdapter<SupportList> {

    public SupportAdapter(Context ctx, List<SupportList> list) {
        super(ctx, list);
    }

    @Override
    public int getItemLayoutId(int viewType) {
        return R.layout.layout_item_order;
    }

    @Override
    public void bindData(RecyclerViewHolder holder, int position, SupportList item) {
        if (item != null)
            holder.setText(R.id.act_title_tv, item.getActTitle())
                    .setText(R.id.act_price_tv, item.getPrice() + "元")
                    .setText(R.id.act_time_tv, DateUtils.stampToDate(item.getDatetime()));
    }
}
